/*
 * Project Name:hbm-be.
 * File Name:OmgAreaServiceImpl.java
 * Package Name:com.hginfo.hbm.be.service.impl.omg
 * Date:2018年04月27日 上午11:17:41
 * Copyright (c) 2016, hongguaninfo.com All Rights Reserved.
 *
 */
package cn.uce.common.omg.biz.impl;

import cn.uce.common.omg.biz.IOmgAreaServiceBiz;
import cn.uce.common.omg.service.OmgAreaService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 地区表.: omg_area. <br />
 * service impl 层 <br />
 * Date: 2018年04月27日 上午11:17:41 <br />
 *
 * @author chenqinglong
 * @since V1.0.0
 */
@Service("OmgAreaServiceBiz")
@Transactional(readOnly = true,propagation= Propagation.SUPPORTS,rollbackFor = Exception.class)
public class OmgAreaServiceBiz implements IOmgAreaServiceBiz {

    @Resource
    private OmgAreaService omgAreaService;

    /**
     * 行政区划-省
     */

    @Override
    public List<Map<String,Object>> getProvince(Integer areaType){
        // TODO Auto-generated method stub
        List<Map<String,Object>> list =  omgAreaService.getProvince(areaType);
        return list;
    }
    /**
     * 行政区划-省\市\县、区\镇
     * zhaocan update
     * 2018-06-27
     * 增加areaType:5乡镇数据查询
     */
    @Override
    public List<Map<String,Object>> getAreaCascade(Integer areaType, String parentAreaCode){
        // TODO Auto-generated method stub
        //处理areaType
        if(areaType==2){
            List<Map<String,Object>> list  =  omgAreaService.getProvince(areaType);
            return list;
        }else if (areaType==3 || areaType == 4||areaType == 5){
            List<Map<String,Object>> list =  omgAreaService.getAreaCascade(areaType,parentAreaCode);
            return list;
        }
        return null;
    }
}
